package net.models;

// Generated 31 mai 2013 16:09:55 by Hibernate Tools 3.4.0.CR1

import java.util.HashSet;
import java.util.Set;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import static javax.persistence.GenerationType.IDENTITY;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;

/**
 * Offrir generated by hbm2java
 */
@Entity
@Table(name = "offrir", catalog = "gsbcr")
public class Offrir implements java.io.Serializable {

	private Integer id;
	private Visiteur visiteur;
	private Medicament medicament;
	private Integer offQte;
	private Set<Rapportvisite> rapportvisites = new HashSet<Rapportvisite>(0);

	public Offrir() {
	}

	public Offrir(Visiteur visiteur, Medicament medicament) {
		this.visiteur = visiteur;
		this.medicament = medicament;
	}

	public Offrir(Visiteur visiteur, Medicament medicament, Integer offQte,
			Set<Rapportvisite> rapportvisites) {
		this.visiteur = visiteur;
		this.medicament = medicament;
		this.offQte = offQte;
		this.rapportvisites = rapportvisites;
	}

	@Id
	@GeneratedValue(strategy = IDENTITY)
	@Column(name = "id", unique = true, nullable = false)
	public Integer getId() {
		return this.id;
	}

	public void setId(Integer id) {
		this.id = id;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "visMatricule", nullable = false)
	public Visiteur getVisiteur() {
		return this.visiteur;
	}

	public void setVisiteur(Visiteur visiteur) {
		this.visiteur = visiteur;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "medDepotlegal", nullable = false)
	public Medicament getMedicament() {
		return this.medicament;
	}

	public void setMedicament(Medicament medicament) {
		this.medicament = medicament;
	}

	@Column(name = "offQte")
	public Integer getOffQte() {
		return this.offQte;
	}

	public void setOffQte(Integer offQte) {
		this.offQte = offQte;
	}

	@OneToMany(fetch = FetchType.LAZY, mappedBy = "offrir")
	public Set<Rapportvisite> getRapportvisites() {
		return this.rapportvisites;
	}

	public void setRapportvisites(Set<Rapportvisite> rapportvisites) {
		this.rapportvisites = rapportvisites;
	}

}
